<template>
	<el-dialog v-model="showModal" :close-on-click-modal="false" class="peak-dialog" :title="title" :width="900">
		<div v-html="htmlCode" />
		<template #footer>
			<span class="dialog-footer">
				<el-button @click="handleCancel">取 消</el-button>
			</span>
		</template>
	</el-dialog>
</template>
<script name="ViewLogModalMonitor" setup>
import { toRefs } from 'vue'

/*
 *@Description: 状态初始化
 *@MethodAuthor: liuYuFeng
 *@Date: 2023-09-11 18:37:20
 */
const state = reactive({
	showModal: false,
	title: '查看详情',
	htmlCode: '',
})

const { showModal, title, htmlCode } = toRefs(state)

/*
 *@Description: 方法模块
 *@MethodAuthor: liuYuFeng
 *@Date: 2023-09-11 18:37:24
 */
const handleCancel = () => {
	state.showModal = false
}
const handleShowModal = async data => {
	state.showModal = true
	await nextTick()
	state.htmlCode = data
}
defineExpose({
	handleShowModal,
})
</script>
<style lang="scss" scoped></style>
